import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
/*public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b=fib(a);

        System.out.println(b);

    }

    public static int fib(int n) {
        if (n == 0 || n == 1) {
            return 1;
        } else {
            return fib(n - 1) + fib(n - 2);
        }
    }
    //斐波那契额数列
}*/

// 注意类名必须为 Main, 不要有任何 package xxx 信息
//public class Main {
//    public static void main(String[] args) {
//        Scanner scanner = new Scanner(System.in);
//        while (scanner.hasNextLine()) { // 注意 while 处理多个 case
//            String a = scanner.nextLine();
//            String b = scanner.nextLine();
//            System.out.println(a.toLowerCase());
//            System.out.println(b.toLowerCase());
//
//        }
//    }
//}
//大写转化为小写

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLine()) {
            String a = scanner.nextLine();
            String b = scanner.nextLine();
            String c = change(a, b);
            System.out.println(c);
        }
    }
        public static String change(String a, String b){
            StringBuilder builder = new StringBuilder();
            for (int i = 0; i < a.length(); i++) {
                char c = a.charAt(i);

                if (b.contains(String.valueOf(c))) {
                    continue;
                }
                builder.append(c);
            }
            return builder.toString();
        }

}
//去掉相同字符




